<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/core/common/taglibs.jsp" %>
<script src="${ctx}/core/scripts/formValidator_min.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
<html>
	<head>
		<title><s:text name='operator.operatorManage'/></title>
		<meta http-equiv="Pragma" content="no-cache">
		<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0">
		<meta http-equiv="Expires" content="0">	
		<script>
			//alert('<s:text name="act"/>');
			$(document).ready(function(){
				$.formValidator.initConfig({
					formid:"form0",
					alertmessage:true,
					tidymode:true,
					onerror:function(msg) {
						alert(msg);
					},
					onsuccess:function() {
						submitForm_ajax('form0',null);
						return false;
					}
				});
				$("#code").formValidator().inputValidator({min:1,onerror:"<s:text name='cacheCode.validate.code'/>"});
				$("#name").formValidator().inputValidator({min:1,onerror:"<s:text name='cacheCode.validate.name'/>"});
				$("#sql").formValidator().inputValidator({min:1,onerror:"<s:text name='cacheCode.validate.sql'/>"});
			});
			$("#returnButton").bind("click", function(event) {
				submit_ajax('system/cacheCodeSearchAction.action?act=query&busiId=searchCacheCode','mainframe');
			});
		</script>
	</head>
	<body>
		<form id="form0" action="system/cacheCodeManager.action" method="post" name="mainform">
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" valign="top">
				<%@include file="/WEB-INF/core/common/message.jsp"%>
				<tr width="100%">
					<td>
						<table border="0" align="center" cellpadding="0" cellspacing="0">
							<tr width="100%">
								<td width="8" height="27" align="left"><img src="${ctx}/core/images/button_05.gif" width="8" height="27" /></td> 
		    					<td width="99%"  align="left" background="${ctx}/core/images/button_06.gif" class="bluecu">&nbsp;<img src="${ctx}/core/images/icon_04.gif" />&nbsp;<s:text name='cacheCode.label.bigTitle'/></td>
		    					<td width="8" align="right"><img src="${ctx}/core/images/button_07.gif" width="8" height="27" /></td>
		    				</tr>
		    			</table>
		    		</td>
		  		</tr>
				<tr>
					<td colspan="3" class="biaoge"  valign="top">
						<table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF">
							<tr align="left">
	      						<!--编码-->
        						<td width="10%" height="20" bgcolor="#DDE4EA" nowrap align="center"><s:text name='cacheCode.label.code'/></td>
		        				<td nowrap width="23%" bgcolor="#DDE4EA" align="left">
		        					<exts:textfield id="code" name="cacheCode.code" value="%{cacheCode.code}" class="textbox_css" style="width:200px" required="true"/>
								</td>
								<!--名称-->
        						<td width="10%" nowrap="nowrap" bgcolor="#DDE4EA" align="center"><s:text name='cacheCode.label.name'/></td>
        						<td width="23%" bgcolor="#DDE4EA" align="left">
        							<exts:textfield id="name" name="cacheCode.name" value="%{cacheCode.name}" class="textbox_css" style="width:200px" required="true"/>
								</td>
								<!--是否缓存-->
        						<td width="10%" nowrap="nowrap" bgcolor="#DDE4EA" align="center"><s:text name='cacheCode.label.isCache'/></td>
        						<td width="24%" bgcolor="#DDE4EA" align="left">
        							<s:if test="pageState!='view'">
										<exts:select 
											list="listYesNo" 
											name="cacheCode.cached" 
											value="%{cacheCode.cached}" 
											listKey="code" 
											listValue="name"/>
									</s:if>
									<s:else>
										<s:text name="%{isCacheText}"/>
									</s:else>
								</td>
      						</tr>
							<tr align="left">
								<!--LIST_SQL-->
								<td height="20" bgcolor="#DDE4EA" nowrap align="center"><s:text name='cacheCode.label.listSql'/></td>
						        <td bgcolor="#DDE4EA" nowrap align="left" colspan="5">
									<exts:textfield id="sql" name="cacheCode.listSql" value="%{cacheCode.listSql}" class="textbox_css" style="width:800px" required="true"/>
								</td>
							</tr>
							<tr>
								<td height="10" colspan="6" background="../core/images/line5.gif"></td>
							</tr>
							<tr>
								<td height="25" colspan="6" align="center">
									<s:if test="pageState=='add'">
							        	<input name="act" type="hidden" value="addSubmit"/>
							        </s:if>
							        <s:elseif test="pageState=='edit'">
							        	<input name="act" type="hidden" value="editSubmit"/>
							        	<input name="oldCode" type="hidden" value="<s:property value='cacheCode.code' />" />
							        	<input name="cacheCode.cachCodeId" type="hidden" value="<s:text name='%{cacheCode.cachCodeId}'/>"/>
							        </s:elseif>
							        <s:if test="pageState!='view'">
										<input id="saveButton" type="submit" class="btn" value="<s:text name='button.save'/>"/>
									</s:if>  
							        <input id="returnButton" type="button" class="btn" value="<s:text name='button.return'/>"/>
								</td>
							</tr>
						</table>
    				</td>
				</tr>
			</table>
		</form> 
	</body>
</html>